package com.zdlog.ler.entity;


import com.google.common.base.Strings;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;


@Entity
@Data
public class LerUser {


    /**
     * 用户id
     * 主键
     */
    @Id
    private String userId;


    /**
     * 用户名称
     */
    private String name;


    /**
     * 用户密码
     */
    private String password;


    /**
     * 用户email
     */
    private String eMail;

    /**
     * 创建时间
     */
    private Date create_time;



    // 校验用户注册
    public static boolean checkRegist(LerUser model) {
        return model != null
                && !Strings.isNullOrEmpty(model.name)
                && !Strings.isNullOrEmpty(model.eMail)
                && !Strings.isNullOrEmpty(model.password);

    }
    // 校验用户登录
    public static boolean checkLogin(LerUser model) {
        return model != null
                && !Strings.isNullOrEmpty(model.eMail)
                && !Strings.isNullOrEmpty(model.password);

    }

    // 校验发送验证码
    public static boolean checkSendMail(LerUser model) {
        return model != null
                && !Strings.isNullOrEmpty(model.eMail)
                && !Strings.isNullOrEmpty(model.name);

    }

}
